package com.lin.java.tool.general.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lin.java.tool.common.model.DataPage;
import com.lin.java.tool.common.model.QueryPage;
import com.lin.java.tool.general.dao.po.SysFileEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: linjiang
 * @date: 2025/4/4
 */
public interface SysFileService extends IService<SysFileEntity> {
    /**
     * 分页查询文件
     *
     * @param page
     * @return
     */
    DataPage<SysFileEntity> listPage(QueryPage page);

    /**
     * 文件上传
     *
     * @param file
     * @return
     */
    String upload(MultipartFile file) throws Exception;

    /**
     * 文件下载
     *
     * @param fileId
     * @param response
     */
    void download(String fileId, HttpServletResponse response) throws IOException;

}
